<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>求红白黑球的个数</title>
</head>
<body>
    <script>
        var red;
        var white;
        var black;
        for(red=0;red<=25;red++){
            for(white=0;white<=25;white++){
                for(black=0;black<=31;black++){
                    if(red+white==25&&white+black==31&&red+black==28)
                    alert("红球："+red+"白球："+white+"黑球："+black);
                }
            }
        }
        document.write(red);
    </script>
</body>
</html>